package ControlLayer;
import ModelLayer.*;

/**
 * Write a description of class LoanCtr here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class LoanCtr
{
    // instance variables - replace the example below with your own
    private LoanRecords loanRecords;

    public LoanCtr()
    {
        loanRecords = LoanRecords.getInstance();

    }

    public void creatLoan(int personID, int dvdNr, int copySerialNr, int loadID, long borrowDate, int borrowPeriod) 
    {

        loanRecords.createLoan(personID, dvdNr, copySerialNr, loadID, borrowDate, borrowPeriod);

    }

    public void updateLoan(int choice, int loanID, String value)
    {
        loanRecords.updateLoan(choice, loanID, value);
    }

    public void deleteLoan(int loanID)
    {
        loanRecords.removeLoan(loanID);
    }

    public Loan getLoan(int loanID)
    {
        return loanRecords.getLoan(loanID);
    }

    public void printLoan(int loanID)
    {
        getLoan(loanID).printLoanInfo();
    }

    public void printAllLoan()
    {
        loanRecords.printAllLoan();
    }

    public void returnLoan(int loanID, long returnDate)
    {
        loanRecords.returnLoan(loanID, returnDate);
    }

    
}
